<template>
    <div class="code_box">
<pre v-highlight>
<code>
    this.$api({
        api: 'api-user-resume-download',
        type: 'download',
        method: 'get'
    }).then(res => {

        this.$store.commit('setAlert', {
            show: true,
            massage: '开始下载',
            type: 'success',
            time: 2,
        })

        let blob = new Blob([res])
        var link = document.createElement('a')
        link.href = window.URL.createObjectURL(blob)
        link.download = this.$store.state.userInfo.data.resumeName + '.pdf'
        link.click()
        //释放内存
        window.URL.revokeObjectURL(link.href)
    })
</code>
</pre>
    </div>
</template>

<script>
    export default {
        name: "v-tip-download",
        data () {
            return {

            }
        }
    }
</script>

<style scoped src="../style.css"></style>
